<ul class="colonnes">
<?php foreach($profiles as $profile){ ?>
    <li>
        <h3>
            <?= $profile->CLPR_LIBEL ?>
        </h3>
        <p class="comment"><?= $profile->CLPR_DETAI ?></p>
        <table border="1" class="liste tarifs">
            <thead>
                <tr>
                    <th>Age</th>
                    <?php foreach($periodes as $periode){ ?>
                    <td><div><?= $periode->PERI_LIBEL ?></div></td>
                    <?php } ?>
                </tr>
            </thead>
            <tbody>
                <?php foreach($ages as $age){ ?>
                <tr>
                    <th><?= $age->CLAG_LIBEL ?></th>
                    <?php foreach($periodes as $periode){ ?>
                    <?php $id1=$profile->CLPR_NUMID; $id2=$age->CLAG_NUMID; $id3=$periode->PERI_NUMID; ?>
                    <td><div><?= $tarifs[$id1][$id2][$id3] ?> €</div></td>
                    <?php } ?>
                </tr>
                <?php } ?>
            </tbody>
        </table>
    </li>
<?php } ?>
</ul>
<form method="post">
    <button name="action" value="pdf">Version PDF</button>
</form>